# coding:utf-8
import numpy as np
from hmmlearn import hmm

states = ["A", "B", "C"]
n_states = len(states)
observations = ["down", "up"]
n_observations = len(observations)
p = np.array([0.7, 0.2, 0.1])  # 主力一开始的操作的可能性P
# 转移矩阵
# 实际意义：主力从前一个操作到后一操作的转换概率A
a = np.array([[0.5, 0.2, 0.3],
              [0.3, 0.5, 0.2],
              [0.2, 0.3, 0.5]])
# 生成预测序列矩阵
# 主力操作对价格的影响B主力操作对价格的影响B
b = np.array([[0.6, 0.2],
              [0.3, 0.3],
              [0.1, 0.5]])
# 隐藏状态的初始概率分布Pi（Π）
# 一周的涨跌
o = np.array([[1, 0, 1, 1, 1]]).T
